Bug 1828181 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Given that we now have a clear separation between UI widgets (ones used at the Mozilla level of products) versus Domain-specific UI widgets (ones used in a specific domain or location in Firefox), we should modify the existing `./mach addwidget` command to handle this new case.

Since domain-specific UI widgets will not live in `toolkit/content/widgets`, the command will need to be modified to take in a file path so that:
- the generated files are put in the proper location
- the correct `jar.mn` file is modified
- If a `chrome.ini` file lives somewhere near the passed in file path, then add an entry for the newly generated file. 
- If there are no chrome tests near the passed in path, then:
  - Create a `chrome.ini` file in the appropriate location
  - Modify the relevant `moz.build` by adding `MOCHITEST_CHROME_MANIFESTS += ["[xyz]/chrome.ini"]`.
    - [Some directories use `test/chrome`, others use `tests/chrome` and some just use `test/`](https://searchfox.org/mozilla-central/search?q=test%2Fchrome.&path=&case=false&regexp=false)

I think we can keep the existing behavior as-is: if no file path is given, then the generated widget must be a "UI widget" and not a "domain-specific widget".
Given that we now have a clear separation between UI widgets (ones used at the Mozilla level of products) versus Domain-specific UI widgets (ones used in a specific domain or location in Firefox), we should modify the existing `./mach addwidget` command to handle this new case.

Since domain-specific UI widgets will not live in `toolkit/content/widgets`, the command will need to be modified to take in a file path so that:
- the generated files are put in the proper location
  - **This includes adding the `[xyz].stories.md` file to `browser/components/storybook/stories`!**
- the correct `jar.mn` file is modified
- If a `chrome.ini` file lives somewhere near the passed in file path, then add an entry for the newly generated file. 
- If there are no chrome tests near the passed in path, then:
  - Create a `chrome.ini` file in the appropriate location
  - Modify the relevant `moz.build` by adding `MOCHITEST_CHROME_MANIFESTS += ["[xyz]/chrome.ini"]`.
    - [Some directories use `test/chrome`, others use `tests/chrome` and some just use `test/`](https://searchfox.org/mozilla-central/search?q=test%2Fchrome.&path=&case=false&regexp=false)

I think we can keep the existing behavior as-is: if no file path is given, then the generated widget must be a "UI widget" and not a "domain-specific widget".

Back to Bug 1828181 Comment 0